﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
using System.IO;

namespace NUMIMAX
{
    public class Coin
    {
        #region Pola
        private string _name; 
        private BitmapImage _image;
        private string _dateOfEmission; 
        private int? _faceValue; 
        private string _circulation; 
        private string _stamp;
        private string _alloy; 
        private string _weight;
        private string _diameter;
        private string _rant; 
        private string _catalogNumber;
        private string _series; 
        private string _index1;
        private string _index2;
        private string _status;
        private int? _setConservationState; 
        private double? _setEmissionPrice;
        private double? _setBuyPrice;
        private double? _setCurrentPrice;
        private int? _investQuantity;
        private double? _investPurchasePrice; 
        private double? _investCurrentPrice;      
        private double? _investTotalWorth;
        private string _userNotes;
        private double? _quantityOfSameCoins; 
        private string _totalSpendOnAllCoins; 
        private string _totalWorthOfAllCoins; 
        private string _numberOfSoldCoins; 
        private string _totalSpendOnSoldCoins;
        private string _totalSellPrice;
        private string _totalBalanceOfAllCoins;
        private string _valueDataInLastMonth1; 
        private string _valueDataInLastMonth2;
        private string _valueDataInLastMonth3;
        private string _valueDataInLastMonth4;
        private string _valueDataInLastMonth5;
        private string _valueDataInLastMonth6;
        private string _valueWorthInLastMonth1;
        private string _valueWorthInLastMonth2;
        private string _valueWorthInLastMonth3;
        private string _valueWorthInLastMonth4;
        private string _valueWorthInLastMonth5;
        private string _valueWorthInLastMonth6;
        private string _valueDataInLastQuarter1;
        private string _valueDataInLastQuarter2;
        private string _valueDataInLastQuarter3;
        private string _valueDataInLastQuarter4;
        private string _valueDataInLastQuarter5;
        private string _valueDataInLastQuarter6;
        private string _valueWorthInLastQuarter1;
        private string _valueWorthInLastQuarter2;
        private string _valueWorthInLastQuarter3;
        private string _valueWorthInLastQuarter4;
        private string _valueWorthInLastQuarter5;
        private string _valueWorthInLastQuarter6;
        private string _valueDataInLastYear1; 
        private string _valueDataInLastYear2;
        private string _valueDataInLastYear3;
        private string _valueDataInLastYear4;
        private string _valueDataInLastYear5;
        private string _valueDataInLastYear6;
        private string _valueWorthInLastYear1; 
        private string _valueWorthInLastYear2;
        private string _valueWorthInLastYear3;
        private string _valueWorthInLastYear4;
        private string _valueWorthInLastYear5;
        private string _valueWorthInLastYear6;
        #endregion

        public Coin(string coin_name, byte[] imageData, string emission_date, int face_value, string circulation, string stamp, string alloy,
                    string weight, string diameter, string rant_of_coin, string catalog_number, string coin_series, string index1,
                    string index2, int conservation_state, double emission_worth, double purchase_price, double current_price, int quantity,
                    double number_of_bought_coins, double value_of_all_coins, double total_worth, string _wmd1, string _wmd2, string _wmd3,
                    string _wmd4, string _wmd5, string _wmd6, string _wmw1, string _wmw2, string _wmw3, string _wmw4, string _wmw5,
                    string _wmw6, string _wkd1, string _wkd2, string _wkd3, string _wkd4, string _wkd5, string _wkd6, string _wkw1,
                    string _wkw2, string _wkw3, string _wkw4, string _wkw5, string _wkw6, string _dataEmisji, string _cenaEmisji,
                    string _wpl1, string _wpl2, string _wpl3, string _wpl4, string _wpl5, string _wpl6, string _wplw1, string _wplw2,
                    string _wplw3, string _wplw4, string _wplw5, string _wplw6)
        {
            MemoryStream memStream = new MemoryStream(imageData);
            BitmapImage image = new BitmapImage();
            image.BeginInit();
            image.StreamSource = memStream;
            image.EndInit();
            this._image = image;
            this._name = coin_name;
            this._dateOfEmission = emission_date;
            this._faceValue = face_value;
            this._circulation = circulation;
            this._stamp = stamp;
            this._alloy = alloy;
            this._weight = weight;
            this._diameter = diameter;
            this._rant = rant_of_coin;
            this._catalogNumber = catalog_number;
            this._series = coin_series;
            this._index1 = index1;
            this._index2 = index2;
            this._setConservationState = conservation_state;
            this._setEmissionPrice = emission_worth;
            this._investPurchasePrice = purchase_price;
            this._investCurrentPrice = current_price;
            this._investQuantity = quantity;
            this._quantityOfSameCoins = number_of_bought_coins;
            this._setBuyPrice = value_of_all_coins;
            this._investTotalWorth = total_worth;
            this._valueDataInLastMonth1 = _wmd1;
            this._valueDataInLastMonth2 = _wmd2;
            this._valueDataInLastMonth3 = _wmd3;
            this._valueDataInLastMonth4 = _wmd4;
            this._valueDataInLastMonth5 = _wmd5;
            this._valueDataInLastMonth6 = _wmd6;
            this._valueWorthInLastMonth1 = _wmw1;
            this._valueWorthInLastMonth2 = _wmw2;
            this._valueWorthInLastMonth3 = _wmw3;
            this._valueWorthInLastMonth4 = _wmw4;
            this._valueWorthInLastMonth5 = _wmw5;
            this._valueWorthInLastMonth6 = _wmw6;
            this._valueDataInLastQuarter1 = _wkd1;
            this._valueDataInLastQuarter2 = _wkd2;
            this._valueDataInLastQuarter3 = _wkd3;
            this._valueDataInLastQuarter4 = _wkd4;
            this._valueDataInLastQuarter5 = _wkd5;
            this._valueDataInLastQuarter6 = _wkd6;
            this._valueWorthInLastQuarter1 = _wkw1;
            this._valueWorthInLastQuarter2 = _wkw2;
            this._valueWorthInLastQuarter3 = _wkw3;
            this._valueWorthInLastQuarter4 = _wkw4;
            this._valueWorthInLastQuarter5 = _wkw5;
            this._valueWorthInLastQuarter6 = _wkw6;
            this._valueDataInLastYear1 = _wpl1;
            this._valueDataInLastYear2 = _wpl2;
            this._valueDataInLastYear3 = _wpl3;
            this._valueDataInLastYear4 = _wpl4;
            this._valueDataInLastYear5 = _wpl5;
            this._valueDataInLastYear6 = _wpl6;
            this._valueWorthInLastYear1 = _wplw1;
            this._valueWorthInLastYear2 = _wplw2;
            this._valueWorthInLastYear3 = _wplw3;
            this._valueWorthInLastYear4 = _wplw4;
            this._valueWorthInLastYear5 = _wplw5;
            this._valueWorthInLastYear6 = _wplw6;
        }

        /// <summary>
        /// Nazwa monety.
        /// </summary>
        public string Name
        {
            get { return _name; }
        }

        /// <summary>
        /// Obrazek monety.
        /// </summary>
        public BitmapImage Image
        {
            get { return _image; }
        }

        /// <summary>
        /// Data emisji.
        /// </summary>
        public string EmissionDate
        {
            get { return _dateOfEmission; }
        }

        /// <summary>
        /// Nominał monety.
        /// </summary>
        public int? FaceValue
        {
            get { return _faceValue; }
        }

        /// <summary>
        /// Nakład money.
        /// </summary>
        public string  Circulation
        {
            get { return _circulation; }
        }

        /// <summary>
        /// Stempel.
        /// </summary>
        public string Stamp
        {
            get { return _stamp; }
        }

        /// <summary>
        /// Stop metalu monety.
        /// </summary>
        public string Alloy
        {
            get { return _alloy; }
        }

        /// <summary>
        /// Waga monety.
        /// </summary>
        public string  Weight
        {
            get { return _weight; }
        }

        /// <summary>
        /// Średnica monety.
        /// </summary>
        public string  Diameter
        {
            get { return _diameter; }
        }

        /// <summary>
        /// Rant monety, czyli rodzaj obwodu, ząbkowany bądź płaski.
        /// </summary>
        public string  Rant
        {
            get { return _rant; }
        }

        /// <summary>
        /// Numer katalogowy monety.
        /// </summary>
        public string CatalogNumber
        {
            get { return _catalogNumber; }
        }

        /// <summary>
        /// Seria monety.
        /// </summary>
        public string Series
        {
            get { return _series; }
        }

        /// <summary>
        /// Pierwszy index.
        /// </summary>
        public string INDEX1
        {
            get { return _index1; }
        }

        /// <summary>
        /// Drugi index.
        /// </summary>
        public string INDEX2
        {
            get { return _index2; }
        }

        /// <summary>
        /// Stan zachowania (w zbiorze).
        /// </summary>
        public int? ConservationStateInSet
        {
            get { return _setConservationState; }
        }

        /// <summary>
        /// Wartość emisji (w zbiorze).
        /// </summary>
        public double?  EmissionWorthInSet
        {
            get { return _setEmissionPrice; }
        }

        /// <summary>
        /// Cena kupna (w inwestycjach).
        /// </summary>
        public double?  PurchasePriceInInvests
        {
            get { return _investPurchasePrice; }
        }

        /// <summary>
        /// Aktualna cena (w inwestycjach).
        /// </summary>
        public double?  CurrentPriceInInvests
        {
            get { return _investCurrentPrice; }
        }

        /// <summary>
        /// Ilość monet (w inwestycjach).
        /// </summary>
        public int? QuantityInInvests
        {
            get { return _investQuantity; }
        }

        /// <summary>
        /// Ilość sztuk tej samej monety w magazynie.
        /// </summary>
        public double?  QuantityOfSameCoins
        {
            get { return _quantityOfSameCoins; }
        }

        /// <summary>
        /// Cena kupna monet (w zbiorze).
        /// </summary>
        public double?  ValueOfAllCoins
        {
            get { return _setBuyPrice; }
        }

        /// <summary>
        /// Bilans zysku/strat zakupionych monet (w inwestycjach).
        /// </summary>
        public double? TotalWorthInInvests
        {
            get { return _investTotalWorth; }
        }

        /// <summary>
        /// Sumaryczna kwota poniesionych wydatków na posiadane monety.
        /// </summary>
        public string TotalSpendOnAllCoins
        {
            get { return _totalSpendOnAllCoins; }
        }

        /// <summary>
        ///Obecna wartosc posiadanych monet (brana z wartosci z aktualizacji).
        /// </summary>
        public string TotalWorthOfAllcoins
        {
            get { return _totalWorthOfAllCoins; }
        }

        /// <summary>
        ///Ilość sprzedanych sztuk.
        /// </summary>
        public string NumberOfSoldCoins
        {
            get { return _numberOfSoldCoins; }
        }

        /// <summary>
        ///Poniesione wydatki na sprzedane monety(wszystkie monety w sumie).
        /// </summary>
        public string TotalSpendOnSoldCoins
        {
            get { return _totalSpendOnSoldCoins; }
        }

        /// <summary>
        ///Cena sprzedaży (wszystkie sprzedane monety w sumie).
        /// </summary>
        public string TotalSellPrice
        {
            get { return _totalSellPrice; }
        }

        /// <summary>
        /// Zysk / strata z wszystkch sprzedanych monet
        /// </summary>
        public string TotalBalanceOfAllCoins
        {
            get { return _totalBalanceOfAllCoins; }
        }

        /// <summary>
        /// Notatki użytkownika.
        /// </summary>
        public string Usernotes
        {
            get { return _userNotes; }
        }

        public string ValueDataInLastMonth1 { get { return _valueDataInLastMonth1; } }
        public string ValueDataInLastMonth2 { get { return _valueDataInLastMonth2; } }
        public string ValueDataInLastMonth3 { get { return _valueDataInLastMonth3; } }
        public string ValueDataInLastMonth4 { get { return _valueDataInLastMonth4; } }
        public string ValueDataInLastMonth5 { get { return _valueDataInLastMonth5; } }
        public string ValueDataInLastMonth6 { get { return _valueDataInLastMonth6; } }
        public string ValueWorthInLastMonth1 { get { return _valueWorthInLastMonth1; } }
        public string ValueWorthInLastMonth2 { get { return _valueWorthInLastMonth2; } }
        public string ValueWorthInLastMonth3 { get { return _valueWorthInLastMonth3; } }
        public string ValueWorthInLastMonth4 { get { return _valueWorthInLastMonth4; } }
        public string ValueWorthInLastMonth5 { get { return _valueWorthInLastMonth5; } }
        public string ValueWorthInLastMonth6 { get { return _valueWorthInLastMonth6; } }
        public string ValueDataInLastQuarter1 { get { return _valueDataInLastQuarter1; } }
        public string ValueDataInLastQuarter2 { get { return _valueDataInLastQuarter2; } }
        public string ValueDataInLastQuarter3 { get { return _valueDataInLastQuarter3; } }
        public string ValueDataInLastQuarter4 { get { return _valueDataInLastQuarter4; } }
        public string ValueDataInLastQuarter5 { get { return _valueDataInLastQuarter5; } }
        public string ValueDataInLastQuarter6 { get { return _valueDataInLastQuarter6; } }
        public string ValueWorthInLastQuarter1 { get { return _valueWorthInLastQuarter1; } }
        public string ValueWorthInLastQuarter2 { get { return _valueWorthInLastQuarter2; } }
        public string ValueWorthInLastQuarter3 { get { return _valueWorthInLastQuarter3; } }
        public string ValueWorthInLastQuarter4 { get { return _valueWorthInLastQuarter4; } }
        public string ValueWorthInLastQuarter5 { get { return _valueWorthInLastQuarter5; } }
        public string ValueWorthInLastQuarter6 { get { return _valueWorthInLastQuarter6; } }
        public string ValueDataInLastYear1 { get { return _valueDataInLastYear1; } }
        public string ValueDataInLastYear2 { get { return _valueDataInLastYear2; } }
        public string ValueDataInLastYear3 { get { return _valueDataInLastYear3; } }
        public string ValueDataInLastYear4 { get { return _valueDataInLastYear4; } }
        public string ValueDataInLastYear5 { get { return _valueDataInLastYear5; } }
        public string ValueDataInLastYear6 { get { return _valueDataInLastYear6; } }
        public string ValueWorthInLastYear1 { get { return _valueWorthInLastYear1; } }
        public string ValueWorthInLastYear2 { get { return _valueWorthInLastYear2; } }
        public string ValueWorthInLastYear3 { get { return _valueWorthInLastYear3; } }
        public string ValueWorthInLastYear4 { get { return _valueWorthInLastYear4; } }
        public string ValueWorthInLastYear5 { get { return _valueWorthInLastYear5; } }
        public string ValueWorthInLastYear6 { get { return _valueWorthInLastYear6; } }
    }
}

